Refactor homepage, remove event entry, and update categories - #15
Merged
Conversation
- 活动入口移除: - TopBar.tsx: 删除"活动"导航链接 - MobileNav.tsx: 删除"活动"tab,grid 从5列改为4列,移除未使用的Calendar图标导入 - layout.tsx: 删除/events的游客可访问路径规则 - Footer.tsx: "活动平台"→"交流平台" - 首页大幅精简 (page.tsx): - 标题改为"为社群而建的空间。" - 新增三行核心文案:"一个让我们彼此看见,也彼此保护的地方。" / "让相遇更安全,让资源在社群里流动。" - 移除右侧装饰卡片、设计原则模块(4项)、底部CTA区、Principle组件定义 - 移除未使用的图标导入(ShieldCheck, Users, Lock, Sparkles, LucideIcon) - 广场分类更新为5个新类别: - enums.ts: PostSection 新增 QUESTION / OFFLINE_MEETUP / REFLECTION,移除 POST,更新标签映射 - post-tags.ts: TAG_TABS 改为 提问求助/线下交友/医疗信息/资源分享/感悟 - worker/llm.ts: 更新 ModeratableSection、PostTag 类型;移除 EVENT/EventIntent/EventDraft/EventCategory/EventFormat 类型;更新系统prompt以反映新分类;移除EVENT处理逻辑 - worker/routes/posts.ts: 移除 EVENT 自动创建活动逻辑(约130行),移除 createEventFromDraft 函数,更新 normalizePostSection 映射 - worker/routes/events.ts: 将 section 比较改为 String() 以兼容类型变化 - Logo: "TransHistoria"→"跨性别空间"
- Footer: "跨性别社群"→"跨性别空间",描述改为"一个让我们彼此看见,也彼此保护的地方。" - 首页: 标题和文案去除句号
- 标题: "动态、医疗、资源,都在这里" → "欢迎在这里分享信息和资源" - 移除: "任何认证成员都可以发帖。系统会自动审核和分类,你只需要把话说清楚。"
新版 pnpm 不再从 package.json 读取 pnpm.overrides, 该配置已被忽略,导致 lockfile 与 package.json 不匹配, CI 中 pnpm install --frozen-lockfile 报 ERR_PNPM_LOCKFILE_CONFIG_MISMATCH。 移除后对齐 lockfile 实际状态。
There was a problem hiding this comment.
Pull request overview
This PR rebrands the app and simplifies the primary UX by removing the “活动 (Events)” entry points from navigation and refocusing the marketing homepage CTA toward the “广场 (Posts)”. It also overhauls post sections/tags and updates worker-side LLM moderation logic/configuration accordingly, plus removes deprecated pnpm override config to fix frozen-lockfile mismatches.
Changes:
- Rebrand UI strings/logo/footer and simplify the marketing homepage hero + CTA to drive users to “广场”.
- Remove “活动” navigation entry points and tighten guest-access routing.
- Replace post sections/tags taxonomy and update LLM moderation prompt/types; remove event-draft extraction/migration logic.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| worker/src/routes/posts.ts | Removes event auto-migration logic; updates post section normalization for new taxonomy. |
| worker/src/routes/events.ts | Adjusts section comparison to avoid TS type overlap issues after moderation type change. |
| worker/src/lib/llm.ts | Updates moderation schema/prompt/tags/sections and removes event-draft extraction logic. |
| worker/.dev.vars | Refreshes local dev vars template and adds LLM configuration placeholders. |
| src/lib/post-tags.ts | Updates controlled post tags + top-level tag tabs to match new taxonomy. |
| src/lib/enums.ts | Updates frontend post section enum/labels to new category set. |
| src/components/layout/TopBar.tsx | Removes “活动” link from desktop top nav. |
| src/components/layout/MobileNav.tsx | Removes events tab and updates grid layout/icon imports. |
| src/components/layout/Logo.tsx | Updates default app name fallback to new branding. |
| src/components/layout/Footer.tsx | Updates footer branding/name and description copy. |
| src/app/(marketing)/page.tsx | Simplifies homepage content and switches logged-in CTA to “逛逛广场”. |
| src/app/(app)/posts/page.tsx | Simplifies posts page header slogan. |
| src/app/(app)/layout.tsx | Restricts guest-accessible routes to profiles only. |
| package.json | Removes pnpm.overrides block. |
| pnpm-lock.yaml | Updates lockfile to match removed overrides and current resolved dependency graph. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+15
to
+20
| export type ModeratableSection = "QUESTION" | "OFFLINE_MEETUP" | "MEDICAL" | "RESOURCE" | "REFLECTION"; | ||
|
|
||
| export type ModerationInputKind = "POST" | "COMMENT" | "EVENT"; | ||
|
|
||
| export type PostTag = | ||
| | "question-help" |
Comment on lines
+243
to
246
| if (String(decision.section) !== "EVENT") { | ||
| verdict = "reject"; | ||
| reason = decision.reason || "内容看起来更像帖子,请改发到「广场」对应板块。"; | ||
| } |
| # Leave LLM_API_KEY empty to disable LLM and fall back to keyword-only filtering. | ||
| LLM_BASE_URL=https://api.deepseek.com/anthropic | ||
| LLM_MODEL=deepseek-v4-flash | ||
| LLM_API_KEY=replace-with-your-key |
Comment on lines
+8
to
+10
| EMAIL_FROM=Trans Community <noreply@example.test> | ||
| APP_NAME=跨性别社群 | ||
| APP_LOCALE=zh-CN |
Comment on lines
+116
to
+120
| // Map LLM section to the posts table section string. | ||
| function normalizePostSection(decisionSection: string): string { | ||
| if (decisionSection === "QUESTION" || decisionSection === "OFFLINE_MEETUP" || | ||
| decisionSection === "MEDICAL" || decisionSection === "RESOURCE" || | ||
| decisionSection === "REFLECTION") return decisionSection; |
Comment on lines
123
to
138
| export const PostSection = { | ||
| POST: "POST", | ||
| QUESTION: "QUESTION", | ||
| OFFLINE_MEETUP: "OFFLINE_MEETUP", | ||
| MEDICAL: "MEDICAL", | ||
| RESOURCE: "RESOURCE", | ||
| REFLECTION: "REFLECTION", | ||
| } as const; | ||
| export type PostSection = (typeof PostSection)[keyof typeof PostSection]; | ||
|
|
||
| export const POST_SECTION_LABEL: Record<PostSection, string> = { | ||
| POST: "动态", | ||
| QUESTION: "提问求助", | ||
| OFFLINE_MEETUP: "线下交友", | ||
| MEDICAL: "医疗信息", | ||
| RESOURCE: "资源分享", | ||
| REFLECTION: "感悟", | ||
| }; |
- enums.ts: 将 POST 加回 PostSection,映射到"提问求助"标签, 避免数据库中旧数据(section="POST")渲染时标签 undefined - .dev.vars: LLM_API_KEY 置空,本地开发默认走纯关键词审核模式; APP_NAME 和 EMAIL_FROM 更新为"跨性别空间"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the platform’s branding and user experience, simplifies navigation, and updates the classification and moderation of posts. The main changes include rebranding the app, streamlining navigation by removing the "活动" (Events) section, and overhauling the post categories and tags to better reflect the community’s focus. There are also improvements to content moderation logic and configuration.
Branding and UI/UX Updates:
/) with simplified, more welcoming language, removed the design principles and activity categories preview sections, and focused the call-to-action on the “广场” (Posts) instead of events. [1] [2]Navigation Simplification:
Post Categories and Tagging Overhaul:
Content Moderation Logic:
Configuration and Environment:
.dev.varsexample to use new branding and clarified documentation, while adding placeholders for LLM moderation configuration.